package com.ctbri.io;

import java.io.File;

import com.ctbri.util.Directory;
import com.ctbri.util.Directory.TreeInfo;

public class Ex4 {

	public static void main(String[] args) {
		TreeInfo info;
		if(args.length == 0) {
			info = Directory.walk(".");
		} else {
			info = Directory.walk(".", args[0]);
		}
		
		long totalSize = 0;
		for(File file : info.files)
			totalSize += file.length();
		
		System.out.println(totalSize);
	}

}
